package com.gonsin.gview.common.bean;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gitee.sunchenbin.mybatis.actable.annotation.Foreign;
import com.gitee.sunchenbin.mybatis.actable.annotation.IsAutoIncrement;
import com.gitee.sunchenbin.mybatis.actable.annotation.TableComment;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Data
@ApiModel("用户和会务中心的关系表")
@TableComment("用户和会务中心的关系表")
@Entity
@Table(name = "gs_user_user_and_edifice")
@ToString
@TableName("gs_user_user_and_edifice")
public class UserAndEdificeBean {

    @Id
    @ApiModelProperty("主键")
    @TableId("user_and_edifice_key")
    @IsAutoIncrement
    @Column(name = "user_and_edifice_key", columnDefinition = "int(11) comment '主键'")
    private int userAndEdificeKey;

    @Foreign(name = "fk_user_key", foreignTable = "gs_user", foreignColumn = "user_key")
    @ApiModelProperty("用户名 即登录账号")
    @TableField("user_key")
    @Column(name = "user_key", columnDefinition = "varchar(64) comment '用户主键'", nullable = false)
    private String userKey;

    @Foreign(name = "fk__edifice_key", foreignTable = "gs_user_edifice", foreignColumn = "edifice_key")
    @ApiModelProperty("会务中心 主键")
    @TableField("edifice_key")
    @Column(name = "edifice_key", columnDefinition = "varchar(64) comment '用户主键'", nullable = false)
    private String edificeKey;

}
